<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body ng-app="myApp" ng-controller="myController">
	<input ng-model="num1" type="text" >+
	<input ng-model="num2" type="text">
	<p ng-bind="result1"></p>
	<script src="angular.js"></script>
	<script>
		var app =angular.module("myApp",[]);
		app.controller("myController",["$scope",function($scope){
			$scope.num1=0;
			$scope.num2=0;
			$scope.result1=0;
			$scope.getResult=function(){
				return ($scope.num1-0)+($scope.num2-0);
			};
			$scope.$watch("getResult()",function(now,old){
				$scope.result1=now;
				// $scope.result1=($scope.num1-0)+($scope.num2-0);
			});
		}]);
	</script>
</body>
</html>
